package com.brainhealth.customer.service.impl;

import java.util.List;
import com.brainhealth.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.brainhealth.customer.mapper.CustomerChatMapper;
import com.brainhealth.customer.domain.CustomerChat;
import com.brainhealth.customer.service.ICustomerChatService;

/**
 * 会员聊天Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-05-17
 */
@Service
public class CustomerChatServiceImpl implements ICustomerChatService 
{
    @Autowired
    private CustomerChatMapper customerChatMapper;

    /**
     * 查询会员聊天
     * 
     * @param customerChatId 会员聊天主键
     * @return 会员聊天
     */
    @Override
    public CustomerChat selectCustomerChatByCustomerChatId(Long customerChatId)
    {
        return customerChatMapper.selectCustomerChatByCustomerChatId(customerChatId);
    }

    /**
     * 查询会员聊天列表
     * 
     * @param customerChat 会员聊天
     * @return 会员聊天
     */
    @Override
    public List<CustomerChat> selectCustomerChatList(CustomerChat customerChat)
    {
        return customerChatMapper.selectCustomerChatList(customerChat);
    }

    /**
     * 新增会员聊天
     * 
     * @param customerChat 会员聊天
     * @return 结果
     */
    @Override
    public int insertCustomerChat(CustomerChat customerChat)
    {
        customerChat.setCreateTime(DateUtils.getNowDate());
        return customerChatMapper.insertCustomerChat(customerChat);
    }

    /**
     * 修改会员聊天
     * 
     * @param customerChat 会员聊天
     * @return 结果
     */
    @Override
    public int updateCustomerChat(CustomerChat customerChat)
    {
        return customerChatMapper.updateCustomerChat(customerChat);
    }

    /**
     * 批量删除会员聊天
     * 
     * @param customerChatIds 需要删除的会员聊天主键
     * @return 结果
     */
    @Override
    public int deleteCustomerChatByCustomerChatIds(Long[] customerChatIds)
    {
        return customerChatMapper.deleteCustomerChatByCustomerChatIds(customerChatIds);
    }

    /**
     * 删除会员聊天信息
     * 
     * @param customerChatId 会员聊天主键
     * @return 结果
     */
    @Override
    public int deleteCustomerChatByCustomerChatId(Long customerChatId)
    {
        return customerChatMapper.deleteCustomerChatByCustomerChatId(customerChatId);
    }
}
